﻿using System;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using Ue.Infrastructure.UI.SkinnedControls.PageParserFilters;

namespace Ue.Infrastructure.UI.SkinnedControls
{
    public class SkinnedUserControl : GenericUserControl
    {
        private SkinnedControl parent;
        public new SkinnedControl Parent
        {
            get
            {
                return this.parent == null
                    ? base.Parent as SkinnedControl
                    : this.parent;
            }
            set
            {
                this.parent = value;
            }
        }
    }

    public class SkinnedUserControl<TParent> : SkinnedUserControl
        where TParent : SkinnedControl
    {
        public new TParent Parent
        {
            get { return (TParent)base.Parent; }
        }
    }

    public class SkinnedUserControl<TParent, TPage> : SkinnedUserControl<TParent>
        where TPage : System.Web.UI.Page
        where TParent : SkinnedControl
    {
        public new TPage Page
        {
            get { return base.Page as TPage; }
        }
    }
}
